package com.app.micaihu.bean.topic;

import android.text.TextUtils;

import com.app.micaihu.R;
import com.app.micaihu.app.AppApplication;
import com.app.micaihu.bean.comment.PariseBean;
import com.app.micaihu.bean.comment.BaseComment;
import com.app.micaihu.bean.comment.ChildComment;
import com.app.micaihu.bean.speak.IAttUser;
import com.app.micaihu.bean.speak.ICommentEntity;
import com.app.micaihu.bean.comment.NormalComment;
import com.app.micaihu.configure.TypeConstant;
import com.app.micaihu.bean.speak.ILaud;

import java.util.List;

/**
 * Created by Guo on 2016/12/21.
 * <p>
 * <p>
 * <p>
 * 帖子详情的网络接受类
 */

public class PostDetailEntity extends BaseComment implements ICommentEntity, ILaud, IAttUser {


    private String headPic;


    private List<NormalComment> hotCmtList;

    private List<NormalComment> normalList;


    private List<String> imgList;

    private String isFans;

    private List<PariseBean> praiseList;

    private String praiseNum;


    private String publishTime;

    private String rankIcon;

    private String rankName;

    private String replyNum;

    /*****************************************/
//    private String shareTitle;// 标题
//    private String shareSummary;// 描述
//    private String shareUrl;// 分享的文章url
//    private String shareImg;// 分享的文章图标

    /*****************************************/

    /**
     * 关注状态
     */
    private String status;

    private String title;

    private String honourPic;//军团勋章
    private String armyGroupInfo;//所属军团 或 军团职位
    private String gid;//所属军团 id


    private String articleThumb;
    private String articleTitle;//所属军团 id
    private String articleSummary;//所属军团 id

    public String getArticleThumb() {
        return articleThumb;
    }

    public void setArticleThumb(String articleThumb) {
        this.articleThumb = articleThumb;
    }

    public String getArticleTitle() {
        return articleTitle;
    }

    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }

    public String getArticleSummary() {
        return articleSummary;
    }

    public void setArticleSummary(String articleSummary) {
        this.articleSummary = articleSummary;
    }

    public String getGid() {
        return gid;
    }

    public void setGid(String gid) {
        this.gid = gid;
    }

    public String getHonourPic() {
        return honourPic;
    }

    public void setHonourPic(String honourPic) {
        this.honourPic = honourPic;
    }

    public String getArmyGroupInfo() {
        return armyGroupInfo;
    }

    public void setArmyGroupInfo(String armyGroupInfo) {
        this.armyGroupInfo = armyGroupInfo;
    }

    /**
     * 得到所有评论
     *
     * @return
     */
    public List<NormalComment> getAllCommentList() {
        if (hotCmtList != null && hotCmtList.size() > 0) {
            //在第一个位置添加热门评论
            NormalComment comment = new NormalComment();
            comment.setCommentTitle(AppApplication.getInstance().getString(R.string.speak_title_hot));
            hotCmtList.add(0, comment);
        }
        if (normalList != null && normalList.size() > 0) {
            //在第一个位置添加最新评论
            NormalComment comment = new NormalComment();
            comment.setCommentTitle(AppApplication.getInstance().getString(R.string.speak_title_new));
            normalList.add(0, comment);
        }
        //拼接两组评论
        if (hotCmtList != null) {
            hotCmtList.addAll(normalList);
        }
        return hotCmtList;
    }

    /**
     * 得到所有评论
     *
     * @return
     */
    public List<NormalComment> getAllQuestionList() {
        if (hotCmtList != null && hotCmtList.size() > 0) {
            //在第一个位置添加热门评论
            NormalComment comment = new NormalComment();
            comment.setCommentTitle("精彩问答");
            hotCmtList.add(0, comment);
        }
        if (normalList != null && normalList.size() > 0) {
            //在第一个位置添加最新评论
            NormalComment comment = new NormalComment();
            comment.setCommentTitle("最新问答");
            normalList.add(0, comment);
        }
        //拼接两组评论
        if (hotCmtList != null) {
            hotCmtList.addAll(normalList);
        }
        return hotCmtList;
    }

    public String getHeadPic() {
        return headPic;
    }

    public void setHeadPic(String headPic) {
        this.headPic = headPic;
    }

    public List<NormalComment> getHotCmtList() {
        return hotCmtList;
    }

    public void setHotCmtList(List<NormalComment> hotCmtList) {
        this.hotCmtList = hotCmtList;
    }

    public List<NormalComment> getNormalList() {
        return normalList;
    }

    public void setNormalList(List<NormalComment> normalList) {
        this.normalList = normalList;
    }

    public List<String> getImgList() {
        return imgList;
    }

    public void setImgList(List<String> imgList) {
        this.imgList = imgList;
    }

    public String getIsFans() {
        return isFans;
    }

    public void setIsFans(String isFans) {
        this.isFans = isFans;
    }

    public List<PariseBean> getPraiseList() {
        return praiseList;
    }

    public void setPraiseList(List<PariseBean> praiseList) {
        this.praiseList = praiseList;
    }

    public String getPraiseNum() {
        return praiseNum;
    }

    public void setPraiseNum(String praiseNum) {
        this.praiseNum = praiseNum;
    }

    public String getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public String getRankIcon() {
        return rankIcon;
    }

    public void setRankIcon(String rankIcon) {
        this.rankIcon = rankIcon;
    }

    public String getRankName() {
        return rankName;
    }

    public void setRankName(String rankName) {
        this.rankName = rankName;
    }

    public String getReplyNum() {
        return replyNum;
    }

    public void setReplyNum(String replyNum) {
        this.replyNum = replyNum;
    }

//    public String getShareTitle() {
//        return shareTitle;
//    }
//
//    public void setShareTitle(String shareTitle) {
//        this.shareTitle = shareTitle;
//    }
//
//    public String getShareSummary() {
//        return shareSummary;
//    }
//
//    public void setShareSummary(String shareSummary) {
//        this.shareSummary = shareSummary;
//    }
//
//    public String getShareUrl() {
//        return shareUrl;
//    }
//
//    public void setShareUrl(String shareUrl) {
//        this.shareUrl = shareUrl;
//    }
//
//    public String getShareImg() {
//        return shareImg;
//    }
//
//    public void setShareImg(String shareImg) {
//        this.shareImg = shareImg;
//    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }


    @Override
    public boolean getNewsOrTopic() {
        return false;
    }

    @Override
    public String getIContent() {
        return getContent();
    }

    @Override
    public String getIFile() {
        return null;
    }

    @Override
    public String getINickName() {
        return getNickName();
    }

    @Override
    public String getIHeadPic() {
        return null;
    }

    @Override
    public String getIRankName() {
        return getHeadPic();
    }

    @Override
    public String getIRankIcon() {
        return getRankIcon();
    }

    @Override
    public String getIPublishTime() {
        return getPublishTime();
    }

    @Override
    public String getICommentTitle() {
        return null;
    }

    @Override
    public boolean getIIsFans() {
        return TextUtils.equals(getIsFans(), "1");
    }

    @Override
    public String getIChildNum() {
        return null;
    }

    @Override
    public List<ChildComment> getIChildList() {
        return null;
    }

    @Override
    public void setIChildList(List<ChildComment> childList) {

    }

    @Override
    public String getIHonourPic() {
        return getHonourPic();
    }

    @Override
    public String getIArmyGroupInfo() {
        return getArmyGroupInfo();
    }


    @Override
    public String getILaudOperateType() {
        return TypeConstant.ZAN_NORMAL;
    }

    @Override
    public String getILaudNum() {
        return getPraiseNum();
    }

    @Override
    public String getILaudType() {
        return TypeConstant.COMMENT_ONE;
    }

    @Override
    public void setILaudNum(String iLaudNum) {
        setPraiseNum(iLaudNum);
    }

    @Override
    public String getNewsId() {
        return getTopicId();
    }

    @Override
    public String getICommentId() {
        return getId();
    }

    @Override
    public String getIParentCmtId() {
        return "0";
    }

    @Override
    public String getIType() {
        return getType();
    }

    @Override
    public String getIToUid() {
        return getUid();
    }

    @Override
    public void setIToUid(String toUid) {

    }


    @Override
    public String getIAttType() {
        return getStatus();
    }

    @Override
    public void setIAttType(String status) {
        setStatus(status);
    }
}
